package com.lovo.project.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lovo.project.bean.SupplierBean;
import com.lovo.project.mapper.SupplierMapper;
import com.lovo.project.service.SupplierService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, SupplierBean> implements SupplierService {
    @Autowired
    SupplierMapper supplierMapper;

    @Override
    public Page<SupplierBean> querySupplierList(Page<SupplierBean> page, QueryWrapper queryWrapper) {
        Page<SupplierBean> page1=supplierMapper.selectPage(page,queryWrapper);
        return page1;
    }

    @Override
    public SupplierBean querySupplier(Integer supplierId) {
        SupplierBean supplierBean=supplierMapper.selectById(supplierId);
        return supplierBean;
    }

    @Override
    public void updateSupplier(SupplierBean supplierBean) {
        supplierMapper.updateById(supplierBean);
    }

    @Override
    public void insertSupplier(SupplierBean supplierBean) {
        supplierMapper.insert(supplierBean);
    }

    @Override
    public List<SupplierBean> querySupplierNameList(QueryWrapper queryWrapper) {

        List<SupplierBean> list=supplierMapper.selectList(queryWrapper);
        return list;
    }
}
